package com.rashith.metro.alfa.webservices;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class HandlingXML extends DefaultHandler {

	public String s;
	public boolean found = false;
	StringBuilder b ;

	@Override
	public void startElement(String uri, String localName, String qName,
			Attributes attributes) throws SAXException {

		if (localName.equals("string")) {
			b = new StringBuilder();
			found = true;
			
		}
	}

	@Override
	public void endElement(String uri, String localName, String qName)
			throws SAXException {
		// TODO Auto-generated method stub
		if (localName.equals("string"))
			s = b.toString();
			found = false;
	}

	@Override
	public void characters(char[] ch, int start, int length)
			throws SAXException {
		if (found) {
			b.append(ch);
		}
	}

}
